<?php
include_once 'classes/DBClass.php';

class Product {	
	var $brand_id;
	var $product_id;
	var $name;
	var $price;
	var $image;
	var $stock;
	var $short_description;
	var $properties;
	var $cat_name;
	
	function getCategoryName()	{	
		$mysql = new DBClass();
		$query = "SELECT * FROM `mf_product` WHERE `product_id` = '". $this->product_id ."'";
		$category = $mysql->Query($query);
		$res = $category[0];
		return $res[2];
	}
	
	function  getBrandName(){
		
	}
	
	function setProduct($ID){
		$this->product_id = $ID;
		$mysql = new DBClass();
		//$this->product_id = "prc-bot-001";
		$query = "SELECT * FROM `mf_vw_campaign_products_category` WHERE `product_id` = '". $this->product_id ."'";
		$productObject = $mysql->Query($query);
		
		$prdct = $productObject[0];
		
		$this->brand_id = $prdct[0];
		$this->product_id = $prdct[1];
		$this->name = $prdct[2];
		$this->price = $prdct[3];
		$this->image = $prdct[4];
		$this->stock = $prdct[5];
		$this->short_description = $prdct[6];
		$this->properties = $prdct[7];
		$this->cat_name = $prdct[8];
	}
}
?>